{% extends 'common/base_admin.html' %}

{% load static %}

{% block content-title %}
数据批量导入
{% if not result %}
，请按下方先后顺序进行数据导入
{% endif %}
{% if result == "success" %}
: <font color="green">{{ item }} 提交结果: {{ result}}, 更新数据条数：{{ inserted_count}} </font>
{% elif result == "fail" %}
: <font color="red">{{item}} 提交结果: {{ result}}, 失败原因：{{ error_info }}</font>
{% endif %}
{% if error_rows %}
<br>
<a href="{% url 'manage:error_download' %}" target="_blank">
  <font color="red">点击下载 {{ error_num }} 个错误信息</font>
</a>
<!-- <font color="red">更新失败行：{{ error_rows }}</font> -->
{% endif %}
{% endblock %}

{% block content %}
<div class="layui-card-header" style="font-weight: bold;">
  批量添加教师信息
</div>
<div class="layui-card-body">
  <div class="layui-btn-container">
    <form class="layui-form" id="teacher_info" action="{% url 'manage:data_add' %}" enctype="multipart/form-data"
      method="post">
      {% csrf_token %}
      <input type="hidden" name="data_info" value="teacher_info">
      <input type="file" name="myfile" class="layui-btn layui-btn-primary layui-btn-fluid layui-btn-sm"> <br>
      <input type="submit" class="layui-btn layui-btn-sm" id="ID-upload-demo-action" value="开始上传">
      <a class="layui-btn layui-btn-primary layui-btn-sm"
        href="{% url 'manage:download_template' id='teacher_info' %}">下载模版</a>
    </form>
  </div>
</div>

<hr>

<div class="layui-card-header" style="font-weight: bold;">
  批量添加班级信息
</div>
<div class="layui-card-body">
  <div class="layui-btn-container">
    <form class="layui-form" action="{% url 'manage:data_add' %}" enctype="multipart/form-data" method="post">
      {% csrf_token %}
      <input type="hidden" name="data_info" value="class_info">
      <input type="file" name="myfile" class="layui-btn layui-btn-primary layui-btn-fluid layui-btn-sm"> <br>
      <input type="submit" class="layui-btn layui-btn-sm" id="ID-upload-demo-action" value="开始上传">
      <a class="layui-btn layui-btn-primary layui-btn-sm"
        href="{% url 'manage:download_template' id='class_info' %}">下载模版</a>
    </form>
  </div>
</div>

<hr>

<div class="layui-card-header" style="font-weight: bold;">
  批量添加课程信息
</div>
<div class="layui-card-body">
  <div class="layui-btn-container">
    <form class="layui-form" action="{% url 'manage:data_add' %}" enctype="multipart/form-data" method="post">
      {% csrf_token %}
      <input type="hidden" name="data_info" value="course_info">
      <input type="file" name="myfile" class="layui-btn layui-btn-primary layui-btn-fluid layui-btn-sm"> <br>
      <input type="submit" class="layui-btn layui-btn-sm" id="ID-upload-demo-action" value="开始上传">
      <a class="layui-btn layui-btn-primary layui-btn-sm"
        href="{% url 'manage:download_template' id='course_info' %}">下载模版</a>
    </form>
  </div>
</div>

<hr>

<div class="layui-card-header" style="font-weight: bold;">
  批量添加班级课程
</div>
<div class="layui-card-body">
  <div class="layui-btn-container">
    <form class="layui-form" action="{% url 'manage:data_add' %}" enctype="multipart/form-data" method="post">
      {% csrf_token %}
      <input type="hidden" name="data_info" value="class_course_info">
      <input type="file" name="myfile" class="layui-btn layui-btn-primary layui-btn-fluid layui-btn-sm"> <br>
      <input type="submit" class="layui-btn layui-btn-sm" id="ID-upload-demo-action" value="开始上传">
      <a class="layui-btn layui-btn-primary layui-btn-sm"
        href="{% url 'manage:download_template' id='class_course_info' %}">下载模版</a>
    </form>
  </div>
</div>

<hr>

<div class="layui-card-header" style="font-weight: bold;">
  批量添加学生信息
</div>
<div class="layui-card-body">
  <div class="layui-btn-container">
    <form class="layui-form" action="{% url 'manage:data_add' %}" enctype="multipart/form-data" method="post">
      {% csrf_token %}
      <input type="hidden" name="data_info" value="student_info">
      <input type="file" name="myfile" class="layui-btn layui-btn-primary layui-btn-fluid layui-btn-sm"> <br>
      <input type="submit" class="layui-btn layui-btn-sm" id="ID-upload-demo-action" value="开始上传">
      <a class="layui-btn layui-btn-primary layui-btn-sm"
        href="{% url 'manage:download_template' id='student_info' %}">下载模版</a>
    </form>
  </div>
</div>
{% endblock %}

</div> -->